package com.smartleanx.module.hrm.api.employee;

import com.smartleanx.framework.common.pojo.CommonResult;
import com.smartleanx.framework.common.util.object.BeanUtils;
import com.smartleanx.module.hrm.api.employee.dto.EmployeeInfoRespDto;
import com.smartleanx.module.hrm.dal.dataobject.employee.EmployeeDO;
import com.smartleanx.module.hrm.service.employee.EmployeeService;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.awt.*;


@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
@Component
public class EmployeeDeptImplApi implements EmployeeDeptApi {
    @Resource
    private EmployeeService employeeService;


    @Override
    public CommonResult<EmployeeInfoRespDto> getByIda( Long id) {
        EmployeeDO employeeByUserId = employeeService.getEmployeeByUserId(id);

        return CommonResult.success(BeanUtils.toBean(employeeByUserId, EmployeeInfoRespDto.class));
    }


}
